<!-- 订单详情 -->
<template>
	<view class="container">
		<view class="section__shop">
			<!-- <image src="/static/images/center/iconClock.png" mode="aspectFill"></image> -->
			<view class="shop__info">
				<view class="tit">商户信息</view>
				<view class="lit__bor">
					<view class="shop__name">商户名称</view>
					<view class="addr">
						<image src="/static/images/index/index_location.png" mode=""></image>
						<text class="shop_address">{{data.seller_name}}</text>
					</view>
				</view>
				<view class="lit__bor both__side" style="height: 80rpx;line-height: 80rpx;">
					<text>营业时间：{{data.business_hours || ''}}</text>
					<view class="contact__shop" @tap="phoneCall(data.phone)">
						<image src="/static/images/public/order_tel.png" mode=""></image>
						<text>联系商户</text>
					</view>
				</view>
			</view>
		</view>
		<view class="section__shop mar__top">
			<!-- <image src="/static/images/center/iconClock.png" mode="aspectFill"></image> -->

			<view class="shop__info">
				<view class="tit">订单信息</view>
				<view class="lit__bor">
					<view class="cell">
						<view class="title">交易单号：</view>
						<text class="value">{{data.order_id}}</text>
					</view>
					<view class="cell">
						<view class="title">付款时间：</view>
						<text class="value">{{data.pay_time || ''}}</text>
					</view>
				</view>
				<view class="lit__bor">
					<view class="cell">
						<view class="title" v-if="data.use_black_conch != '0.00'">黑贝壳抵扣：</view>
						<view class="title" v-if="data.use_yellow_conch != '0.00'">黄贝壳抵扣：</view>
						<view class="title" v-if="data.use_red_conch != '0.00'">红贝壳抵扣：</view>
						<view class="title" v-if="data.use_blue_conch != '0.00'">蓝贝壳抵扣：</view>
						<text class="value">￥<text class="font_w_bold">{{data.use_conch || '0.00'}}</text></text>
					</view>
					<view class="cell">
						<view class="title">余额抵扣：</view>
						<text class="value">￥<text class="font_w_bold">{{data.use_now_money || '0.00'}}</text></text>
					</view>
					<view class="cell">
						<view class="title" v-if="data.pay_type == 'weixin'">微信支付：</view>
						<view class="title" v-else>支付宝支付：</view>
						<text class="value">￥<text class="font_w_bold">{{data.pay_price || '0.00'}}</text></text>
					</view>
				</view>
				<view class="lit__bor both__side">
					<text>消费金额： ￥<text class="font_w_bold">{{data.total_price || '0.00'}}</text></text>
					<view v-if="data.shop_commission_retrun_mode == 1">获得黑贝壳：<image class="shellicon" src="/static/images/public/shellIcon.png" mode=""></image><text class="font_w_bold">{{data.gain_conch || '0.00'}}</text></view>
					<view v-if="data.shop_commission_retrun_mode == 2">获得积分：<text class="font_w_bold">{{data.gian_integral || '0.00'}}</text></view>
				</view>
			</view>
		</view>
		<view class="paySuccess" v-if="paySuccessShow" @tap="paySuccess">
			<button class="paySub" type="default">完 成</button>
		</view>
		<!-- <view class="explan" @tap="phoneCall">如有疑问请咨询客服热线：123123123</view> -->
	</view>
</template>

<script>
	import {offlineOrderDetail} from "@/api/order.js"
	import utils from '@/utils/util.js'
	export default {
		components: {
		},
		data() {
			return {
				paySuccessShow: false,
				data: {
					use_black_conch: "0.00",
					use_yellow_conch: "0.00",
					use_red_conch: "0.00",
					use_blue_conch: "0.00",
				}
			}
		},
		onLoad(option) {
			if(option.id) {
				this.paySuccessShow = true
				offlineOrderDetail({
					order_id: option.id
				}).then(res => {
					this.data = res.data._info
					this.data.pay_time = utils.formatDate(new Date(this.data.pay_time*1000));
				})
			} else {
				this.data =  JSON.parse(decodeURIComponent(option.item));
			}
		},
		methods: {
			phoneCall(tel){
				uni.makePhoneCall({
					phoneNumber: tel
				});
			},
			paySuccess() {
				uni.reLaunch({
					url:"/pages/index/index"
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		width: 91%;
		margin: 0 auto;
		// padding: 20rpx;
		font-size: 28rpx;
		.lit__bor{
			font-size: 26rpx;
			padding: 20rpx 0;
			border-top: 1px solid #EEEEEE;
			.shop__name{
				margin-bottom: 15rpx;
			}
			.shellicon{
				width: 30rpx;
				height: 19rpx;
				margin-right: 5rpx;
			}
			.cell{
				display: flex;
				line-height: 40rpx;
				.title{
					min-width: 150rpx;
					font-size:24rpx;
					font-weight:400;
					color:#999999;
				}
				.value{
					font-size:24rpx;
					font-weight:400;
					color:#333333;
				}
			}
			.contact__shop{
				font-size: 24rpx;
				color: #58BF6B;
				border:1px solid rgba(87,190,106,1);
				border-radius:15rpx;
				padding: 10rpx;
				line-height: 45rpx;
				height: 45rpx;
				display: flow-root;
				image{
					width: 24rpx;
					height: 25rpx;
					margin-right: 8rpx;
				}
			}
			.addr{
				display: flex;
				align-items: center;
				image{
					width: 16rpx;
					height: 21rpx;
				}
				.shop_address{
					font-size:20rpx;
					margin-left: 9rpx;
					font-family:Source Han Sans CN;
					font-weight:400;
					color:rgba(153,153,153,1);
				}
			}
		}
		.both__side{
			display: flex;
			justify-content: space-between;
			
			
		}
		.section__shop{
// 			display: flex;
// 			justify-content: space-between;
			padding: 25rpx 13rpx 5rpx;
			margin-top: 40rpx;
			background:rgba(255,255,255,1);
			box-shadow:0rpx 0rpx 10rpx 0rpx rgba(51,51,51,0.1);
			border-radius:10rpx;
// 			image{
// 				width: 80rpx;
// 				height: 80rpx;
// 			}
			.shop__info{
				
				width: 91%;
				margin: 0 auto;
				padding: 0 20rpx;
				.tit{
					font-size:24rpx;
					font-weight:400;
					color:rgba(51,51,51,1);
					margin: 5rpx 0 14rpx 0;
				}
			}
		}
		.mar__top{
			margin-top: 80rpx;

		}
		.explan{
			font-size: 24rpx;
// 			text-align: center;
// 			margin-top: 100rpx;
			position: fixed;
			bottom: 20rpx;
			left: 50%;
			width: 68%;
			margin-left: -34%;
			height: 44px;
		}
		.font_w_bold{
			font-weight: bold;
		}
		.paySuccess{
			.paySub{
				background-color: $theme-color;
				line-height: 80rpx;
				height: 80rpx;
				border-radius: 40rpx;
				color: #fff;
				text-align: center;
				font-size: 32rpx;
				font-weight: bold;
				margin: 80rpx 0;
			}
		}
			
	}
</style>
